<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/admin.css" />
<style>
.layui-form-label{ width:130px;}
.layui-input-block{ margin-left:160px;}
</style>
</head>
<body>
<div class="">
  <form class="layui-form edit-form" method="post" action="{:url()}" style="width: 90%;padding-top: 20px;">
    {present name="info.id"}
    <input type="hidden" name="id" value="{$info.id|default=''}" />
    {/present}
    <input type="hidden" name="mid" value="{$info.mid|default=input('mid')}" />
    
    <div class="layui-form-item">
      <label class="layui-form-label">表单分组：</label>
      <div class="layui-input-block">
        <select name="group" lay-verify="required">
          {volist name='_group' id='vo'}
          <option value="{$key}">{$vo}</option>
          {/volist}
          
        </select>
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">表单项：</label>
      <div class="layui-input-block">
        <input type="text" name="title" value="{$info.title|default=''}" required lay-verify="required" placeholder="请填写表单项" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">字段名：</label>
      <div class="layui-input-block">
        <input type="text" name="name" value="{$info.name|default=''}" required lay-verify="required" placeholder="请填写字段名" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">类型：</label>
      <div class="layui-input-block">
        <select name="type" lay-verify="required">
          <option value=""></option> 
          {volist name='_typearr' id='vo'}
          <option value="{$vo.name}">{$vo.title}</option>
          {/volist}
          
        </select>
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">字段长度：</label>
      <div class="layui-input-block">
        <input type="text" name="length" value="{$info.length|default=''}" placeholder="请输入字段长度" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">选项：</label>
      <div class="layui-input-block">
        <textarea name="option" placeholder="请输入单选、多选，下拉选项" class="layui-textarea">{$info.option|default=''}</textarea>
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">默认值：</label>
      <div class="layui-input-block">
        <input type="text" name="value" value="{$info.value|default=''}" placeholder="请输入默认值" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">表单描述：</label>
      <div class="layui-input-block">
        <input type="text" name="des" value="{$info.des|default=''}" placeholder="请输入表单描述" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    
    <div class="layui-form-item">
      <label class="layui-form-label">显示：</label>
      <div class="layui-input-block">
        <select name="display" lay-verify="required">
          <option value="1">显示</option> 
          <option value="0">不显示</option> 
          <option value="2">新增时显示</option> 
          <option value="3">编辑时显示</option> 
        </select>
      </div>
    </div>

    
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn layui-btn-normal ajax-post-btn" lay-submit lay-filter="formDemo">提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>
  </form>
</div>
<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="__STATIC__/js/common.js" type="text/javascript" charset="utf-8"></script> 
<script>
			//Demo
			layui.use(['form'], function() {
				var form = layui.form();
				form.render();
				//监听提交
				form.on('submit(formDemo)', function(data) {
					//layer.msg(JSON.stringify(data.field));
					ajax_post('edit-form',true,'iframe171','');
					return false;
				});
				
			});

		
{present name="info.id"}
$(function(){
	setValue("group", "{$info.group|default=0}");
	setValue("type", "{$info.type|default=0}");
	setValue("display", "{$info.display|default=1}");
});
{/present}
</script>


</body>
</html>